Repository navigation
fix: collapse dropdown toggle on second click - #6725
Conversation
There was a problem hiding this comment.
Pull request overview
Adds click-collapse handling for native dropdown components.
Changes:
- Adds a 200 ms reopen guard.
- Records popup closure times across all three dropdown variants.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
shell/Ui/Dropdown.qml |
Guards trigger clicks after popup closure. |
shell/Ui/SearchableDropdown.qml |
Adds equivalent searchable-dropdown handling. |
shell/Ui/MultiSelect.qml |
Adds equivalent multi-select handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| onClosed: { | ||
| root.lastPopupClosed = Date.now() | ||
| searchField.text = "" | ||
| } |
| id: popup | ||
| x: 0 | ||
| y: trigger.height + Style.spacing.xxs | ||
| onClosed: root.lastPopupClosed = Date.now() |
| onClosed: { | ||
| root.lastPopupClosed = Date.now() | ||
| searchField.text = "" | ||
| } |
882f279 to
67e9955
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (3)
shell/Ui/SearchableDropdown.qml:164
- A rapid second click can still reopen the dropdown while its enter transition is running.
Popup.openedremains false until the transition completes, even though the popup is visible; the release policy then closes it beforeonClicked, leaving both checks false and callingopen()again. Capturepopup.visibleat press time so an opening or exiting popup is treated as expanded.
onPressed: _wasOpenAtPress = popup.opened
shell/Ui/Dropdown.qml:142
- A rapid second click can still reopen the dropdown while its enter transition is running.
Popup.openedremains false until the transition completes, even though the popup is visible; the release policy then closes it beforeonClicked, leaving both checks false and callingopen()again. Capturepopup.visibleat press time so an opening or exiting popup is treated as expanded.
onPressed: _wasOpenAtPress = popup.opened
shell/Ui/MultiSelect.qml:330
- A rapid second click can still reopen the dropdown while its enter transition is running.
Popup.openedremains false until the transition completes, even though the popup is visible; the release policy then closes it beforeonClicked, leaving both checks false and callingopen()again. Capturepopup.visibleat press time so an opening or exiting popup is treated as expanded.
onPressed: _wasOpenAtPress = popup.opened
I measured it on (Qt 6.11 + Quickshell): popup.opened is true during the enter transition (the Opening state), even with Material's 220ms |
|
Reviewed at 67e9955 and reproduced on a disposable Omarchy VM (Qt 6.11.2, Quickshell in a live Hyprland session). No changes needed. The bug is real and still on Nothing else regressed. On every tree, clicking outside still closes the popup, clicking an option still selects it and closes, and clicking another control's trigger closes the first popup and opens the second. The shell suite gave the same result on this head as on its merge base: 1948 passed, and the same 2 files failed on both ( Copilot's suggestion to capture Codex at medium effort reviewed the change separately and found no defect. It agreed the change is proportionate. It noted that This is waiting on a maintainer. |
67e9955 to
9094f31
Compare
|
9094f31 to
51d154e
Compare
|
Re-reviewed at 51d154e, the new approach using The fix works. A harness loaded the real Nothing else regressed. On every tree, clicking outside still closes the popup, picking an option in
Suite. Codex at medium effort reviewed the change separately and found no defect. It agreed the bug is real and the diff proportionate, and that the This is waiting on a maintainer. |
(cherry picked from commit c050166)
dropdown, multi select, and searchable dropdown qml components try to expand again on click when they are already expanded, correct behavior should be to collapse